package com.yitao.client.constant.cashCoupons;

import com.skipper.base.bean.DataOutput;
import com.yitao.client.dto.enums.EnumDto;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: wwl
 * @Date: 2020/3/12 19:22
 * @Description:
 */
public class CashCouponsInfoEnums {

    /**
     *
     * ！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！
     *
     * 修改用户使用状态枚举时，记得要去看下 CashCouponsEnums1 这个类
     *
     *
     *
     */

    public static enum ConversionStatusEnum {
        NO_CHANGE(1, "未兑换"),
        YES_CHANGE(2, "已兑换"),
        DELETE(3, "禁用");

        private final Integer code;
        private final String desc;

        private ConversionStatusEnum(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public Integer getCode() {
            return this.code;
        }

        public String getDesc() {
            return this.desc;
        }

        public static String getDescByCode(Integer code) {
            CashCouponsInfoEnums.ConversionStatusEnum[] var1 = values();
            int var2 = var1.length;

            for(int var3 = 0; var3 < var2; ++var3) {
                CashCouponsInfoEnums.ConversionStatusEnum e = var1[var3];
                if (e.getCode().equals(code)) {
                    return e.getDesc();
                }
            }

            return null;
        }

        public static DataOutput<EnumDto> getConversionStatusEnum() {
            List<EnumDto> list = new ArrayList();
            CashCouponsInfoEnums.ConversionStatusEnum[] var1 = values();
            int var2 = var1.length;

            for(int var3 = 0; var3 < var2; ++var3) {
                CashCouponsInfoEnums.ConversionStatusEnum e = var1[var3];
                EnumDto enumDto = new EnumDto();
                enumDto.setCode(e.code);
                enumDto.setDesc(e.desc);
                list.add(enumDto);
            }

            return new DataOutput(list);
        }
    }

    public static enum UseStatusEnum {
        NO_USE(1, "未使用"),
        YES_USE(2, "已使用"),
        OUT_DATE(3, "已过期");

        private final Integer code;
        private final String desc;

        private UseStatusEnum(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public Integer getCode() {
            return this.code;
        }

        public String getDesc() {
            return this.desc;
        }

        public static String getDescByCode(Integer code) {
            CashCouponsInfoEnums.UseStatusEnum[] var1 = values();
            int var2 = var1.length;

            for(int var3 = 0; var3 < var2; ++var3) {
                CashCouponsInfoEnums.UseStatusEnum e = var1[var3];
                if (e.getCode().equals(code)) {
                    return e.getDesc();
                }
            }

            return null;
        }

        public static DataOutput<EnumDto> getUseStatusEnum() {
            List<EnumDto> list = new ArrayList();
            CashCouponsInfoEnums.UseStatusEnum[] var1 = values();
            int var2 = var1.length;

            for(int var3 = 0; var3 < var2; ++var3) {
                CashCouponsInfoEnums.UseStatusEnum e = var1[var3];
                EnumDto enumDto = new EnumDto();
                enumDto.setCode(e.code);
                enumDto.setDesc(e.desc);
                list.add(enumDto);
            }

            return new DataOutput(list);
        }
    }
}
